home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 17914 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.1 KB  |  27 lines

  1. Path: qualcomm.com!not-for-mail
  2. From: drew@qualcomm.com (Drew Eckhardt)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: File I/O using fwrite()
  5. Date: 17 Apr 1996 20:47:15 -0600
  6. Organization: QUALCOMM, Incorporated; San Diego, CA, USA
  7. Message-ID: <4l4afj$jsh@qualcomm.com>
  8. References: <31758D70.1D38@vixa.voyager.net>
  9. NNTP-Posting-Host: littlebear.qualcomm.com
  10.  
  11. In article <31758D70.1D38@vixa.voyager.net>,
  12. David Wade  <dwade@vixa.voyager.net> wrote:
  13. >For some reason, no matter what I do the information is always written 
  14. >at the end of the file instead of where I want it to replace...  
  15.  
  16. >        f=_fsopen(".\\data\\weapons.dat", "ab+", SH_DENYNONE);
  17.  
  18. _fsopen is not an ANSI standard C++ function, and is therefore outside the 
  19. scope of this newsgroup.  Assuming the type parameter has the same semantics
  20. as the standard fopen() function, you're telling it to always append to the
  21. file.  Using "w+b" would do what you want.
  22.  
  23. -- 
  24. <a href="http://www.poohsticks.org/drew/">Home Page</a>
  25. Four boxes : soap, ballot, jury, ammo.  | Work: drew@Qualcomm.COM       
  26. Use in that order.                      | Play: drew@PoohSticks.ORG    
  27.